
 
/**
 * Add insertAt and removeAt to javascript's array.
 * @module utils
 * @class Array
 */
(function(){
	/**
	 * Insert a new element to array
	 * @method insertAt
	 */
	Array.prototype.insertAt = function(index, value )
	{
		var part1 = this.slice( 0, index );
		var part2 = this.slice( index );
		part1.push( value );
		
		return(part1.concat( part2 ));
	};
	
	/**
	 * Remove an element in array
	 * @method removeAt
	 */
	Array.prototype.removeAt = function(index)
	{
		var part1 = this.slice(0,index+1);
		var part2 = this.slice(index+1);
		part1.pop();
		return( part1.concat( part2 ) );
	}
}

